<?php
/**
 * 页码验证
 * User: Owen Zhang
 * Date: 2020/3/17
 * Time: 中午10:24
 */

namespace app\common\validate;

use app\common\Validate;

class PagerValidate extends Validate
{
    public function rules()
    {
        return [
            'page_no' => 'require|number|gt:0',
            'page_count' => 'require|number|between:1,50'
        ];
    }

    public function message()
    {
        return [
            'page_no.require' => '页码必须是数字',
            'page_no.number' => '页码必须是数字',
            'page_no.gt' => '页码必须大于0',
            'page_count.require' => '每页数量必须是数字',
            'page_count.number' => '每页数量必须是数字',
            'page_count.between' => '每页数量必须在1-50之间'
        ];
    }
}
